A. Yusuf Ali:Translation:
So he 1742 began (the search) with their baggage,
before (he came to) the baggage 1743 of his brother:
at length he brought it 1744 out of his brother´s
baggage. Thus did We plan for Joseph. He could not
take his brother by the law of the king except that
Allah 1745 willed it (so). We raise to degrees (of
wisdom) whom 1746 We please: but over all endued
with knowledge is one, the All-Knowing.

Muhammad Asad:Translation:
Thereupon [they were brought before Joseph to be searched; and] he began with the bags of his half-brothers 75 before the bag of his brother [Benjamin]: and in the end he brought forth the drinking Cups 76 out of his brother's bag. In this way did We contrive for Joseph [the attainment of his heart's desire]: under the King's law, he would [otherwise] not have been able to detain his brother, had not God so willed. We do raise to [high] degrees [of knowledge] whomever We will - but above everyone who is endowed with knowledge there is One who knows all. 77
1742 The pronoun "he" can only refer to Joseph. He may have been present all the time, or he may just have come up, as the supposed theft of the king's own cup (12:72 above) was a very serious and important affair, and the investigation required his personal supervision. All that his officers did by his orders was his own act. As the lawyers say: Qui facit per alium, facit per se (whoever does anything through another, does it himself).
1743 The Arabic word here used is wia', plural aw'iyah, which includes bags, lockers, boxes, or any receptacles in which things are stored. Notice the appropriateness of the words used. The cup was concealed in a saddlebag (rahl) , verse 70 above. When it comes to searching, they must search all the baggage of every description if the search was to be convincing and effective.
1744 It refers to the drinking cup, the siqayah, which is a feminine noun: hence the feminine pronoun, ha, in Arabic.
1745 Let no one suppose that it was a vulgar or wicked trick, such as we sometimes hear of in police courts, when property is planted on innocent men to get them into trouble. On the contrary, it was a device or stratagem whose purpose was to show up wickedness in its true colours, to give it a chance of repentance, to bring about forgiveness and reconciliation, to give solace to the aged father who had suffered so much, and above all, to further that larger plan for the instruction of the world, which is unfolded in Israel's religious history. Joseph was a Prophet of Allah, but he could not have carried out this plan or taken the first step, of detaining his brother, except with the will and permission of Allah, Whose Plan is universal and for all His creatures. (R).
1746 If we examine this world's affairs, there are all sorts of plans, and all degrees of folly and wisdom. The wicked ones plan; the foolish ones plan; the simple ones plan; then there are men who think themselves wise and are perhaps thought to be wise, but who are foolish, and they have their plans: and there are degrees of real and beneficent wisdom among men. Allah, the Universal Planner, is above all. Anything good in our wisdom is but a reflection of His wisdom, and His wisdom can even turn folly and wickedness to good.